document.querySelector('form').onsubmit=function(){
    let formdata=new FormData();
    formdata.append('account',document.querySelector('#email').value);
    formdata.append('password',document.querySelector('#password').value);
    axios.post('https://ty.php800.cn/api/member/login.php',formdata,{
        headers:{
            // TOKEN: localStorage.getItem('token'),
            // SAT:'1234567'
        }
    }).then((res)=> {
        let { verify, msg, token, user } = JSON.parse(res.request.responseText);
        console.log(res)
        if(verify){
            localStorage.setItem('token',token)
            localStorage.setItem('user',JSON.stringify(user))
            location.href='index.html'
        }else{
            console.log(msg)
        }
    });
}
function hide_show(eye,password){
    let chane_eye=document.querySelector(eye),
        input=document.querySelector(password)
        chane_eye.onclick=function(){
        if(input.type=="text"){
            input.type="password";
            this.innerHTML="&#xe61a;"
        }else{
            input.type="text";
            this.innerHTML="&#xe71c;"
        }
    }
}
hide_show('.eye','[type=password]');